import {redirect} from "react-router-dom"
import store from "@/store/index.js";
import  {userDeleteActions} from "@/store/actions/userAction.js";
import {deleteData} from "@/utils/localstorage.js";


export default async function logoutAction() {
    // 清除store
    store.dispatch(userDeleteActions());
    // 清除localstrong
    deleteData("currentUser")
    return  redirect('/')
}